package com.web58.velocity.service;

import java.util.concurrent.Future;

import org.apache.commons.lang.StringUtils;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.AsyncResult;
import org.springframework.stereotype.Service;

import com.web58.velocity.bean.User;
import com.web58.velocity.dao.UserDao;

@Service
public class UserService {


	private UserDao userDao=new UserDao();


	@Async
	public Future<Void> execute() {
		return new AsyncResult<Void>(null);
	}


	@Async
	public Future<User> findByName( String name ) {
		return new AsyncResult<User>(userDao.findByName(name));
	}


	@Async
	public Future<Void> addUser(User user ) {
		userDao.insert(user);
		return new AsyncResult<Void>(null);
	}

}
